package com.yao.springcloud;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

@EnableZuulProxy
@SpringBootApplication
public class ServiceZuulApplication {

	private final Logger logger = LoggerFactory.getLogger(ServiceZuulApplication.class);

	@Value("${spring.application.name}")
	private String applicationName;

	@Value("${server.port}")
	private String port;

	public static void main(String[] args) {
		SpringApplication.run(ServiceZuulApplication.class, args);
	}

	@Bean
	public CommandLineRunner runner() {
		logger.info("===========服务[{} {}]启动完成===========", applicationName, port);
		return null;
	}
}
